package cn.tedu.boot08.mapper;

import cn.tedu.boot08.entity.Banner;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 作者：HeShaoShuai
 * @Email 邮箱：2569819541@qq.com
 * @Date 日期：2023/5/16 9:28
 * @Package 包名：cn.tedu.boot08.mapper
 * @Project 项目名：JavaSE
 * @Version 1.0
 */
@Mapper
public interface BannerMapper {
	@Insert("INSERT INTO banner VALUES(NULL,#{url},#{des})")
	void insert(Banner banner);
	@Select("SELECT * FROM banner")
	List<Banner> select();

	@Delete("DELETE FROM banner WHERE id=#{id}")
	void deleteById(int id);

	@Select("SELECT url FROM banner WHERE id=#{id}")
	String selectUrlById(int id);

}